<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
 <script type="text/javascript" src="${staticPath}/lib/jquery-autocomplete/1.1/jquery.autocomplete.min.js"></script>
 	<link rel="stylesheet" href="${staticPath}/lib/jquery-autocomplete/1.1/jquery.autocomplete.css" />
	<script type="text/javascript">
		$(document).ready(function() { 
			//选择招商分类
			var opt = {
					idField : "cateNo",
					nameField : "cateName",
					multiple : false,
					service : "selectCMCateDataService",
					title: "招商分类"
				};
			$("#cmCateDialogMultiple").Dialog(opt);
			//自动补全
			 var options={
					 width: 200,
					 highlight: false,
					 multiple: false,
					 scroll: true,
					 max:10,
					 scrollHeight: 300
				};
			 $("#brandCname").autocomplete("${contextPath}/biz/brand/brand/autocompleteBrandName?name=cn",options );
			 $("#brandEname").autocomplete("${contextPath}/biz/brand/brand/autocompleteBrandName?name=en",options );
		});
		function clearCateInfo()
		{
			$("#cateNo").val("");
			$("#cateName").val("");
		}
		$(function() {
			$("#toSap").removeAttr("disabled");
		});
	</script>
</head>
<body>
	<form:form name="listForm" action="" modelAttribute="brandCate" method="post" class="form-inline" role="form">
		<ol class="breadcrumb map_1">
			<li><a href="${contextPath}/index">首页</a></li>
			<li><a href="${contextPath}/biz/brand/supplier/userinfo?navId=${navId}">供应商品牌</a></li>
			<li class="active">品牌列表</li>
		</ol>
	    <input type="hidden" name="deleteIds" >
	    <input type="hidden" name="sendIds" >
    	<div class="o-l-search-builder f_1">
    	<div id="statement-search-builder" class="collapse" style="height:auto;">
    		<div class="f_2">
	                 <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_4">品牌中文名：</label>
	                      <div class="col-sm-9 f_6">
	                       	<form:input id="brandCname" htmlEscape="false" path="brandCname"class="f_5" autocomplete="off"/>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_7">品牌英文名：</label>
	                      <div class="col-sm-9 f_6">
	                         <form:input id="brandEname" path="brandEname"class="f_5"/>
	                      </div>
	                  </div>
	             </div>
    		<div class="f_2">
	                 <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_4">品牌类型：</label>
	                      <div class="col-sm-9 f_6">
	                        <ossp:select dictType="BRAND_TYPE" defaultSelected="${ brandCate.brandType}" name="brandType" id="brandType" class_="f_5"></ossp:select>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
						<label for="brandStatus" class="col-sm-3 control-label f_4">品牌状态:</label>
						<div class="col-sm-9 f_6">
							<ossp:select dictType="brandStatus" defaultSelected="${brandCate.status}" name="status"id="status" class_="f_5"></ossp:select>
						</div>
					</div>
	             </div>
	             <div class="f_2">
	            	<div class="form-group col-sm-6">
	   					<label for="levelId" class="col-sm-3 control-label f_4">品牌等级:</label>
					    <div class="col-sm-9 f_6">
					    <ossp:select dictType="" service="selectBrandLevelDataService" value="${brandCate.levelId }" name="levelId"id="levelId" class_="f_5 required"></ossp:select>
						</div>
					</div>
					<div class="form-group col-sm-6">
						<label for="inputtext3" class="col-sm-3 control-label f_4">招商分类:</label>
						<div class="col-sm-9 f_6">
						<form:hidden path="cateNo" id="cateNo"/>
							<div class="input-group">
							<form:input id="cateName" path="cateName"class="f_5" readonly="true"/>
							  <span class="input-group-btn f_time" onclick="clearCateInfo();"><span class="glyphicon glyphicon-remove"></span></span>
					 		  <span class="input-group-btn">
						        <button class="btn btn-default btn_3" id="cmCateDialogMultiple" type="button">
						        	选择
						        </button>
						      </span>
							</div>
						</div>
					</div>
				</div>
	         </div>
	         <div class="f_8">
	              <div class="f_2">
	                  <div class="col-sm-8 f_6">
	                        <form:input id="brandNo" path="brandNo"class="f_5" placeholder="品牌编号"/>
	                  </div>
	                  <button type="submit" class="btn btn-warning btn_1">查&nbsp;询</button>
	             </div>
	         </div>
	         <div class="o-l-chevron-down"><a href="#" class="btn btn-default" data-toggle="collapse" data-target="#statement-search-builder" id="chevronDownBtn" role="button"><span id="glyphiconspan" class="glyphicon glyphicon-chevron-up"></span></a>
	         </div>
	     </div>
    	<div class="o-l-search-builder f_1">
    		  <button type="button" class="btn btn-danger btn_5 btn_right" onclick="Oosp_DelAll('${contextPath}/biz/brand/brandcate/deleteAll?navId=${navId }','table1')">删&nbsp;除</button>
    		  <button type="button" id="toSap" class="btn btn-info btn_5 btn_right" onclick="send_IDs('${contextPath}/biz/brand/brandcate/sapAll?navId=${navId }','table1')">发送SAP</button>
              <button type="button" class="btn btn-info btn_5 btn_right" onclick="window.open('${contextPath}/biz/brand/brandcate/add?navId=${navId }','_self')">新&nbsp;建</button>
        </div>   
		<tags:message content="${message}"/>
		<div class="o-l-search-builder f_9">
		<table class="table table-striped table-hover o-l-table table-bordered" id="table1">
			<thead class="t_1">
				<tr>
					<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
					<th>编号</th>
					<th>中文名</th>
					<th>英文名</th>
					<th>招商分类</th>
					<th>类别</th>
					<th>等级</th>
					<th>状态</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${page.list}" var="brandCate">
					<tr  data-herf="${contextPath}/biz/brand/brandcate/${brandCate.id}/view?navId=${navId }" data-target="_self">
						<td class="o-l-tab-ckb">
							<input type="checkbox" data-ckb-id="${brandCate.id}">
						</td>
						<td>${brandCate.brandNo}</td>
						<td>${brandCate.brandCname}</td>
						<td>${brandCate.brandEname}</td>
						<td>${brandCate.cateName}</td>
						<td><ossp:value dictType="BRAND_TYPE" key="${brandCate.brandType}"/></td>
						<td>${brandCate.levelName}</td>
						<td><ossp:value dictType="brandStatus" key="${brandCate.status}"/></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}" url="" total="${page.total}"/>
	<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
</form:form>
</body>
</html>